'''
Created on 2010/08/23

@author: yukiyonezawa
'''
class CharacterSet(object):
    
    BASE_30_BASIC = [{"Val":1, "Char":"A", "Decimal":65},
                    {"Val":2, "Char":"B", "Decimal":66},
                    {"Val":3, "Char":"C", "Decimal":67},
                    {"Val":4, "Char":"D", "Decimal":68},
                    {"Val":5, "Char":"E", "Decimal":69},
                    {"Val":6, "Char":"F", "Decimal":70},
                    {"Val":7, "Char":"G", "Decimal":71},
                    {"Val":8, "Char":"H", "Decimal":72},
                    {"Val":9, "Char":"I", "Decimal":73},
                    {"Val":10, "Char":"J", "Decimal":74},
                    {"Val":11, "Char":"K", "Decimal":75},
                    {"Val":12, "Char":"L", "Decimal":76},
                    {"Val":13, "Char":"M", "Decimal":77},
                    {"Val":14, "Char":"N", "Decimal":78},
                    {"Val":15, "Char":"O", "Decimal":79},
                    {"Val":16, "Char":"P", "Decimal":80},
                    {"Val":17, "Char":"Q", "Decimal":81},
                    {"Val":18, "Char":"R", "Decimal":82},
                    {"Val":19, "Char":"S", "Decimal":83},
                    {"Val":20, "Char":"T", "Decimal":84},
                    {"Val":21, "Char":"U", "Decimal":85},
                    {"Val":22, "Char":"V", "Decimal":86},
                    {"Val":23, "Char":"W", "Decimal":87},
                    {"Val":24, "Char":"X", "Decimal":88},
                    {"Val":25, "Char":"Y", "Decimal":89},
                    {"Val":26, "Char":"Z", "Decimal":90}]
    
    @staticmethod
    def getValByCharFromBASE30(char):        
        for character_set in CharacterSet.BASE_30_BASIC:
            if char == character_set["Char"]:
                return character_set["Val"]
    
    @staticmethod
    def getCharByValFormBASE30(val):
        for character_set in CharacterSet.BASE_30_BASIC:
            if val == character_set["Val"]:
                return character_set["Char"]
        
    